package edu.hawaii.duedates.user;

import static org.junit.Assert.*;
import org.junit.Test;

/**
 * This will test the User class.
 * 
 * @author Ronn Reeves and Robin E. Raqueno
 * 
 */
public class TestUser {

  /**
   * Test creating a user.
   */
  @Test
  public void testCreateUser() {
    String userId = "uid";
    String password = "pwd";
    String name = "name";
    User user = new User(null, null, null);
    user.setEmail(userId);
    user.setPassword(password);
    user.setName(name);
    user.setValid(true);
    user.getLibrary().clear();
    assertEquals("User.getName() test failed.", name, user.getName());
    assertTrue("List is empty.", user.getLibrary().isEmpty());
    assertEquals("User.getUserID() test failed.", userId, user.getEmail());
    assertEquals("User.getPassword() test failed.", password, user.getPassword());
    assertTrue("User.isValid() test failed.", user.isValid());
    assertEquals("User.toString() test failed.", userId, user.toString());
  }
}
